import React from 'react';
import { Layout, Row } from 'tdesign-react';
import { useAppSelector } from 'modules/store';
import { selectGlobal } from 'modules/global';
import Style from './Footer.module.less';

const { Footer: TFooter } = Layout;

const Footer = () => {
  const globalState = useAppSelector(selectGlobal);
  const { version } = globalState;
  const bottomText = globalState.collapsed ? version : ` V${version}`;
  if (!globalState.showFooter) {
    return null;
  }

  return (
    <TFooter>
      <Row justify='center' className={Style.copyright}>
        版权所有 © 河南科技学院 图书馆包间预约系统{bottomText}
      </Row>
      <Row justify='center' className={Style.copyright}>
        地址：河南省新乡市华兰大道东段90号 邮编：453003
      </Row>
    </TFooter>
  );
};

export default React.memo(Footer);
